﻿using Csb.RabbitMq.Commons.Components.RabbitMq.EasyNetQ;
using EasyNetQ;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Csb.RabbitMQ.Common.Components.RabbitMq
{
    public static class RabbitMqHelper
    {
        public static async Task Run()
        {
            var bus = RabbitHutch.CreateBus("host=127.0.0.1;virtualHost=/;username=guest;password=guest");
            MQPublish mQPublish = new MQPublish(bus);
            string message = "clientMessage";
            for (int i = 0; i < 2000; i++)
            {
                await mQPublish.PublishMessageAsync("MQueue", $"[Client3] Sent {i +0};" + message);
                await Task.Delay(100);
            }
        }

    }
}
